//
//  YuEPayView.m
//  ShangChengMoBan
//
//  Created by 张铁军 on 16/9/29.
//  Copyright © 2016年 ping. All rights reserved.
//

#import "YuEPayView.h"

@implementation YuEPayView
{
    UIView *_view;
}

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
    }
    
    return self;
}

-(void)initView{
    self.alpha = 0.0;
    self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4];
    
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    [self addGestureRecognizer:tap];
   
    _view = [[UIView alloc]initWithFrame:CGRectMake(25, KScreenHeight/2-75, KScreenWidth-50, 152)];
    _view.backgroundColor = [UIColor colorWithHue:0.00 saturation:0.00 brightness:0.93 alpha:1.00];
    [self addSubview:_view];
    UILabel * lable = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth-50, 35)];
    lable.backgroundColor = [UIColor redColor];
    lable.textColor = [UIColor whiteColor];
    lable.text = @"验证登录密码!";
    lable.textAlignment = NSTextAlignmentCenter;
    lable.font = [UIFont systemFontOfSize:13];
    [_view addSubview:lable];
    _inputTextField = [[UITextField alloc]initWithFrame:CGRectMake(0, lable.bottom, KScreenWidth-50, 65)];
    _inputTextField.textAlignment = NSTextAlignmentCenter;
    _inputTextField.font = [UIFont systemFontOfSize:13];
    _inputTextField.backgroundColor = [UIColor whiteColor];
    [_view addSubview:_inputTextField];
    UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, _inputTextField.bottom+1, KScreenWidth-50, 50)];
    button.backgroundColor = [UIColor whiteColor];
    [button setTitle:@"确定" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize:13];
    [button addTarget:self.delegate action:@selector(queMiMaEnd) forControlEvents:UIControlEventTouchUpInside];
    [_view addSubview:button];
}

-(void)tap:(UITapGestureRecognizer *)tap{
    self.alpha = 0.0;
    self.hidden = YES;
    
//    [UIView animateWithDuration:0.5 animations:^{
//        self.yv = KScreenHeight;
//    }];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
